#!/bin/bash

# [GARETH] Unfortunately I can't seem to get -X to work so I have to use all the -x on the command line. Pretty ugly, but functional. I also can't seem to specify a complete path with -x (e.g., indra/lscript/lscript_compile/lex_yy.cpp) but this seems ok

#diff -N -x *.ncb -x *.tmp -x *.gif -x *.exe -x *.dll -x *.pyc -x *.suo -x *.dll -x Debug -x Debug_fb -x ReleaseNoOpt -x Release -x Release_fb -x ReleaseForDownload -x *.lib -x lib_* -x lex_yy.cpp -x ytab.* -x message.xml -x message_template.msg -x *.dat -x plugins -r linden/indra secondlife/Linden-Original/indra > RC-1.18.3.5.diff

# [GARETH] Example of how to automate the construction of a diff list, could be used to copy the different files into a clean directory to avoid having to upload all code?
#diff -q -N -x "BuildLog.htm" -x "*.ncb" -x "*.tmp" -x "*.gif" -x "*.exe" -x "*.dll" -x "*.pyc" -x "*.suo" -x "*.dll" -x Debug -x Debug_fb -x ReleaseNoOpt -x Release -x Release_fb -x ReleaseForDownload -x "*.lib" -x "lib_*" -x lex_yy.cpp -x "ytab.*" -x message.xml -x message_template.msg -x "*.dat" -x plugins -r linden/indra Linden-Original/indra | awk '/Files (.*) and (.*) differ/ { print "cp", $2, "destination/" $2 }'

export cmdLine='diff '

export quietOptions='-q'

export normalOptions='-N -x "BuildLog.htm" -x "*.ncb" -x "*.tmp" -x "*.gif" -x "*.exe" -x "*.dll" -x "*.pyc" -x "*.suo" -x "*.pdb" -x "*.bak" -x "*.dll" -x Debug -x Debug_fb -x ReleaseNoOpt -x Release -x Release_fb -x ReleaseForDownload -x "*.lib" -x "lib_*" -x lex_yy.cpp -x "ytab.*" -x message.xml -x message_template.msg -x "*.dat" -x plugins -r '

export target='linden/indra Linden-Original/indra'

export awkOptions=" | awk '/Files (.*) and (.*) differ/ { print \"cp\", \$2, \"destination/\" \$2 | \"bash\"  }'"

export diffOptions=" > RC-1.18.3.5.diff"

eval $cmdLine $quietOptions $normalOptions $target $awkOptions
eval $cmdLine $normalOptions $diffOptions $target

cp produceDiff.sh destination/linden
cp RC-1.18.3.5.diff destination/linden

